SIGNAL
Section: MINTLIB LIBRARY FUNCTIONS
(3)
Updated: 3 March 1993
Index
Return to Main Contents
NAME
signal - software signal facilities
SYNOPSIS
#include <signal.h>
__Sigfunc signal(int sig, __Sigfunc func);
__Sigfunc is defined in <signal.h> in the following way:
typedef void (*__Sigfunc) (int signum);
DESCRIPTION
Signals are only handled properly when MiNT is active.
You are advised to read the entries for Psignal, Psigaction,
Psigpause and Psigblock for the mechanism used.
When MiNT is not active, signals are emulated under TOS. This
fails to handle all types of signals properly.
Signals for MiNT are explained in the document signal.doc,
which comes with the MiNT distribution.
A signal is generated by some abnormal event, initiated by a
user at a terminal (quit, interrupt, stop), by a program error
(bus error, etc.), by request of another program (kill), or
when a process is stopped because it wishes to access its
control terminal while in the background. Signals are optionally
generated when a process resumes after being stopped, when the
status of child processes changes, or when input is ready at the
control terminal. Most signals cause termination of the receiving
process if no action is taken; some signals instead cause the
process receiving them to be stopped, or are simply discarded if
the process has not requested otherwise. Except for the SIGKILL
and SIGSTOP signals, the signal call allows signals either to
be ignored or to interrupt to a specified location.
For a list of signals and their default actions, see the file
signal.doc.
If func is SIG_DFL, the default action for signal sig is
reinstated. If func is SIG_IGN the signal is subsequently
ignored and pending instances of the signal are discarded.
Otherwise, when the signal occurs further occurrences of the
signal are automatically blocked and func is called.
A return from the function unblocks the handled signal and
continues the process at the point it was interrupted.
After a fork or vfork the child inherits all signals.
An execve resets all caught signals to the default
action; ignored signals remain ignored.
RETURN VALUES
signal returns the previous action on success. On
failure, it returns -1 and sets errno to indicate the error.
SEE ALSO
execve(3),
fork(3),
getrlimit(3),
kill(3),
sigblock(3),
sigsetmask(3),
vfork(3)
NOTE
As the document signal.doc shows, signals under MiNT
work in a rather different way than the UN*X version.
Also, the names and types of signals supported are
different from the UN*X version.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- SEE ALSO
-
- NOTE
-
This document was created by
man2html,
using the manual pages.
Time: 11:16:17 GMT, June 22, 2025